import 'package:flutter/material.dart';
import 'package:t2app/src/Config.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:t2app/src/WebView.dart';
import 'package:t2app/src/common/Home.dart';
import 'package:t2app/src/view/login/Login.dart';
import 'package:t2app/src/view/login/LoginIndex.dart';
import 'package:t2app/src/view/my/My.dart';



void main() {
  runApp(MyApp());
}


class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    Config.initConfigEasyLoading(); //交互组件
    return MaterialApp(
          title: '软件万事屋',
          theme: Config.THEME,
          debugShowCheckedModeBanner: false,
          home: new Home(),
          routes: {
            "loginIndex": (BuildContext context) => new LoginIndexView(),
            "login": (BuildContext context) => new LoginView(),
            "home": (BuildContext context) => new Home(),
            "my": (BuildContext context) => new MyView(),
            'webview': (context) {
              final args = ModalRoute.of(context)?.settings.arguments as Map<String, String>?;
              final url = args?['url']?? 'https://www.baidu.com';
              final title = args?['title']?? 'In - App WebView';
              return WebView(url: url, title: title);
            },
          },
          builder: EasyLoading.init(),
        );
  }
}
